package com.tmxk.employee.service.impl;

import com.tmxk.employee.dao.TScheduleDao;
import com.tmxk.employee.dao.impl.TScheduleDaoImpl;
import com.tmxk.employee.pojo.entity.TSchedule;
import com.tmxk.employee.service.TScheduleService;

import java.util.List;
import java.util.Map;

public class TScheduleServiceImpl implements TScheduleService {
    private TScheduleDao tScheduleDao = new TScheduleDaoImpl();
    @Override
    public List<TSchedule> queryAllSchedule(Map<String, Object> map) {
        return tScheduleDao.queryAllSchedule(map);
    }

    @Override
    public boolean saveSchedule(TSchedule schedule) {
        int saveRes =  tScheduleDao.addSchedule(schedule);
        return saveRes > 0 ? true : false;
    }

    @Override
    public boolean updateSchedule(String id, String status) {
        return tScheduleDao.update(id,status) > 0 ? true : false;
    }

    @Override
    public boolean deleteSchedule(String id) {
        return tScheduleDao.deleteSchedule(id) > 0 ? true : false;
    }


}
